/**
 * AgaEngine (c)2011.
 * FileName:Physics.java
 */
package aga.engine.physic;

import org.jbox2d.dynamics.World;
import org.jbox2d.dynamics.joints.Joint;
import org.jbox2d.dynamics.joints.JointDef;

import android.graphics.Canvas;

/**
 * 
 * @author User
 */
public abstract class PhysicJoint extends Physic {
	//===========================================================
	//Constants
	//===========================================================

	
	//===========================================================
	//Fields
	//===========================================================
	protected JointDef jointDef;
	protected Joint joint;
	
	//===========================================================
	//Constructors
	//===========================================================
	protected PhysicJoint(World world) {
        super(world);

		jointDef = new JointDef();
	}
	
	//===========================================================
	//Getter & Setter
	//===========================================================
	public Joint getJoint() {
		return joint;
	}

	public void setJoint(Joint joint) {
		this.joint = joint;
	}
	
	public JointDef getJointDef() {
		return jointDef;
	}

	public void setJointDef(JointDef jointDef) {
		this.jointDef = jointDef;
	}
	
	public float getX() {
		return joint.getBodyB().getPosition().x;
	}
	
	public float getY() {
		return joint.getBodyB().getPosition().y;
	}
	
	//===========================================================
	//Methods for/from SuperClass/Interfaces
	//===========================================================
	public abstract void draw(Canvas canvas);
	
	//===========================================================
	//Methods
	//===========================================================

	//===========================================================
	//Inner and Anonymous Classes
	//===========================================================
}
